from flask_restful import fields

news_fields = {
    'hash_id': fields.String,
    'title': fields.String,
    # 'content': fields.String,
    'type_id': fields.Integer,
    'img_url': fields.String,
    'author': fields.String,
    'news_from': fields.String,
    'create_time': fields.DateTime(dt_format='iso8601'),
    'store_up_num': fields.Integer,
    'comment_num': fields.Integer,
    'click_num': fields.Integer,
}

kind_fields = {
    'type_id': fields.Integer,
    'type': fields.String,
}

news_news_fields = {
    'news': fields.Nested(kind_fields),
    'news_list': fields.List(fields.Nested(news_fields))
}

recreation_news_fields = {
    'recreation': fields.Nested(kind_fields),
    'recreation_list': fields.List(fields.Nested(news_fields))
}

sports_news_fields = {
    'sports': fields.Nested(kind_fields),
    'sports_list': fields.List(fields.Nested(news_fields))
}

finance_news_fields = {
    'finance': fields.Nested(kind_fields),
    'finance_list': fields.List(fields.Nested(news_fields))
}

science_news_fields = {
    'science': fields.Nested(kind_fields),
    'science_list': fields.List(fields.Nested(news_fields))
}

car_news_fields = {
    'car': fields.Nested(kind_fields),
    'car_list': fields.List(fields.Nested(news_fields))
}

woman_news_fields = {
    'woman': fields.Nested(kind_fields),
    'woman_list': fields.List(fields.Nested(news_fields))
}

house_news_fields = {
    'house': fields.Nested(kind_fields),
    'house_list': fields.List(fields.Nested(news_fields))
}

travel_news_fields = {
    'travel': fields.Nested(kind_fields),
    'travel_list': fields.List(fields.Nested(news_fields))
}

education_news_fields = {
    'education': fields.Nested(kind_fields),
    'education_list': fields.List(fields.Nested(news_fields))
}

public_news_fields = {
    'public': fields.Nested(kind_fields),
    'public_list': fields.List(fields.Nested(news_fields))
}

school_news_fields = {
    'school': fields.Nested(kind_fields),
    'school_list': fields.List(fields.Nested(news_fields))
}

kind_news_fields = {
    'news_news': fields.Nested(news_news_fields),
    'recreation_news': fields.Nested(recreation_news_fields),
    'sports_news': fields.Nested(sports_news_fields),
    'finance_news': fields.Nested(finance_news_fields),
    'science_news': fields.Nested(science_news_fields),
    'car_news': fields.Nested(car_news_fields),
    'woman_news': fields.Nested(woman_news_fields),
    'house_news': fields.Nested(house_news_fields),
    'travel_news': fields.Nested(travel_news_fields),
    'education_news': fields.Nested(education_news_fields),
    'public_news': fields.Nested(public_news_fields),
    'school_news': fields.Nested(school_news_fields),
}

news_div_fields = {
    'hot_news': fields.List(fields.Nested(news_fields)),
    'now_news': fields.List(fields.Nested(news_fields)),
    'img_news': fields.List(fields.Nested(news_fields)),
    'banner_news': fields.List(fields.Nested(news_fields)),
    'kind_news': fields.Nested(kind_news_fields)
}

home_data_fields = {
    'kind': fields.List(fields.Nested(kind_fields)),
    'news_div': fields.Nested(news_div_fields),
}

home_result = {
    'status': fields.Integer,
    'msg': fields.String,
    'data': fields.Nested(home_data_fields)
}

cat_news_fields = {
    'type': fields.Nested(kind_fields),
    'hot_news': fields.List(fields.Nested(news_fields)),
    'news_list': fields.List(fields.Nested(news_fields)),
    'page': fields.Integer
}

kind_data_fields = {
    'kind': fields.List(fields.Nested(kind_fields)),
    'news': fields.Nested(cat_news_fields),
}

kind_result = {
    'status': fields.Integer,
    'msg': fields.String,
    'data': fields.Nested(kind_data_fields)
}

detail_data_fields = {
    'kind': fields.List(fields.Nested(kind_fields)),
    'new': fields.Nested(news_fields),
    'new_type': fields.Nested(kind_result),
}

detail_result = {
    'status': fields.Integer,
    'msg': fields.String,
    'data': fields.Nested(detail_data_fields)
}
